<template>
	<el-form  :model="outform" label-width="80px">
	
		

		<el-form-item label="外出原因">
			<el-input v-model="outform.outReason"></el-input>
		</el-form-item>
		<el-form-item label="外出时间">
			<el-date-picker
						      v-model="outform.outTime"
						      type="date"
							  value-format="yyyy-MM-dd"
						      placeholder="选择日期">
						    </el-date-picker>
		</el-form-item>
		<el-form-item label="归来时间">
			<el-date-picker
						      v-model="outform.returnTime"
						      type="date"
							  value-format="yyyy-MM-dd"
						      placeholder="选择日期">
						    </el-date-picker>
		</el-form-item>
		<el-form-item label="陪同人员">
			<el-input v-model="outform.company"></el-input>
		</el-form-item>
		<el-form-item label="陪同关系">
			<el-input v-model="outform.relation"></el-input>
		</el-form-item>
		<el-form-item label="联系电话">
			<el-input v-model="outform.telphone"></el-input>
		</el-form-item>

		<el-form-item label="登记时间">
			<el-date-picker
						      v-model="outform.realTime"
						      type="date"
							  value-format="yyyy-MM-dd"
						      placeholder="选择日期">
						    </el-date-picker>
		</el-form-item>		
		<el-button type="primary" @click="doOutEdit">提交</el-button>
	</el-form>
</template>

<script>
	
	export default{
		name:'OutEdit',
		props:{
			formData:{
				type:Object,
				default:()=>({})
			},
			editVisible:{
				type:Boolean,
			}
		},
		data(){
			return {
				outform:{
					patientId:'',
					outReason:'',
					outTime:'',
					returnTime:'',
					compay:'',
					relation:'',
					telphone:'',
					realTime:''
	
																		}
			}
		},
		mounted(){
					this.outform=this.formData;
					console.log("子组件数据:");
					console.log(this.outform)
				},
				methods:{
					doOutEdit(){

						
					
						this.postRequest("/out-registrate/update",this.outform).then(resp=>{
							if(resp){
								this.$emit("update:editVisible",false);
							}else{
								this.$message.error({message:'编辑失败'});
							}
						})
					}
				},
				watch:{
					formData:{
						deep:true,
						handler(newVal,oldVal){
							this.outform=newVal
						}
					}
				}
	}
</script>

<style>
</style>
